{% extends "templates/main_template.html.j2" %}

{% import "macros/markdown_textarea.html.j2" as MARKDOWN_TEXTAREA %}
{% import "macros/tab_switcher.html.j2" as TAB_SWITCHER %}



{% block title %}Новый проект · Farado{% endblock %}

{% set active_menu = 'projects' %}


{#----------------------------------------------------------------------------#}
{% block styles %}
  <link href="/static/css/page-toolbar.css" rel="stylesheet" type="text/css" />
  {{ MARKDOWN_TEXTAREA.STYLES() }}
{% endblock %}


{#----------------------------------------------------------------------------#}
{% block breadcrumb %}
  <ol class="breadcrumb">
    <li class="breadcrumb-item active" aria-current="page">Новый проект</li>
  </ol>
{% endblock %}


{#----------------------------------------------------------------------------#}
{% block content %}
  <div class="row placeholders">
    <form class="row g-3" action="/projects/project" method="post">

      {# Project.caption #}
        <div class="col-12">
          <label for="inputCaption" class="form-label">Название проекта</label>
          <input
              type="text"
              name="target_project_caption"
              class="form-control"
              id="inputCaption"
              required>
        </div>
      {# /Project.caption #}

      {# Project.content #}
        <div class="col-12">
          <label for="contentTab" class="form-label">Описание</label>
          {{ MARKDOWN_TEXTAREA.INPUT(
                tab_id='contentTab',
                result_id='target_project_content_result',
                field_name='target_project_content' )
          }}
        </div>
      {# /Project.content #}

      {# Project.issues_view_settings #}
        <div class="col-12">
          <label
              for="input_issues_view_settings"
              class="form-label">
            Просмотр настроек запросов
          </label>
          {# TODO поле ввода заменить на адекватный ui позволяющий выбрать столбцы таблицы с issues #}
          <input
              type="text"
              name="target_project_issues_view_settings"
              class="form-control"
              id="input_issues_view_settings"
              value="id,kind,state,caption,parent">
        </div>
      {# /Project.content #}

      <div class="col-md-12">
        <div class="button-container">
          <button type="submit" id="saveButton" class="btn btn-success">
            <i class="bi bi-save"></i> Сохранить
          </button>
        </div>
      </div>

    </form>
  </div>
{% endblock content %}


{#----------------------------------------------------------------------------#}
{% block scripts %}
  {{ MARKDOWN_TEXTAREA.SCRIPTS() }}

  <script>
    document_ready_function = function() {
      {{ TAB_SWITCHER.DOCUMENT_READY_SCRIPT('contentTab') }}
    }
  </script>
{% endblock %}
